package HomeWork.Work_01;

/**
 * 求1000以内的勾股数
 * 所谓勾股数，一般是指能够构成直角三角形3条边的3个正整数（a,b,c）
 * a*a+b*b=c*c
 */
public class Pythagorean {
    public static void main(String[] args) {
        pythagorean();
    }
    public static void pythagorean() {
        for(int a = 1; a <= 1000; a++){
            for(int b = a; b <= 1000; b++){
                for(int c = b; c <= 1000; c++){
                    if(a * a + b * b == c * c && a + b > c){
                        System.out.println("a为：" + a + "，b为：" + b + "，c为：" + c);
                    }
                }
            }
        }
    }
}
